package com.cxxx.guns.modular.portal.controller;
//
//                       _oo0oo_
//                      o8888888o
//                      88" . "88
//                      (| -_- |)
//                      0\  =  /0
//                    ___/`---'\___
//                  .' \\|     |// '.
//                 / \\|||  :  |||// \
//                / _||||| -:- |||||- \
//               |   | \\\  -  /// |   |
//               | \_|  ''\---/''  |_/ |
//               \  .-\__  '-'  ___/-. /
//             ___'. .'  /--.--\  `. .'___
//          ."" '<  `.___\_<|>_/___.' >' "".
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//         \  \ `_.   \_ __\ /__ _/   .-` /  /
//     =====`-.____`.___ \_____/___.-`___.-'=====
//                       `=---='
//
//
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//               佛祖保佑         永无BUG
//

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.cxxx.guns.modular.backend.model.Teachers;
import com.cxxx.guns.modular.backend.service.ITeachersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;

/**
 * @author: yyi
 * @date: 2018/9/16 20:17
 * @parameters:
 * @desc:
 **/
@Controller
@RequestMapping(value = "/portal")
public class IndexMenuController {
    private static String PREFIX="/portal/";
    @Autowired
    private ITeachersService teachersService;
    /*学校简介*/
    @RequestMapping(value = "/about")
    public String about(Model model){
        return PREFIX +"childhtml/school/school/about/starself.html";
    }
    /*领导班子*/
    @RequestMapping(value = "/leader")
    public String leader(Model model){
        /*领导班子的teachers_class的等级是1*/
        Wrapper<Teachers> wrapper = new EntityWrapper<>();
        wrapper.eq("teachers_class",1);
         List<Teachers> list = teachersService.selectList(wrapper);
         model.addAttribute("list",list);
        return PREFIX +"childhtml/school/school/people/starimglist.html";
    }
    /*学校荣誉*/
    @RequestMapping(value = "/honnor")
    public String honnor(Model model){
        return PREFIX +"childhtml/school/school/honor/starself.html";
    }
    /*教师风采*/
    @RequestMapping(value = "/teachers")
    public String Teacher(Model model){
        //分别查询所有的教师分组
        //id 为2 对应的是数学组
        Wrapper<Teachers> wrapperM = new EntityWrapper<>();
        wrapperM.eq("teachers_class",2);
        List math = teachersService.selectList(wrapperM);
        //id 为3 对应的是语文组
        Wrapper<Teachers> wrapperC = new EntityWrapper<>();
        wrapperC.eq("teachers_class",3);
        List chinese = teachersService.selectList(wrapperC);
        //id 为4 对应的是心里组
        Wrapper<Teachers> wrapperP = new EntityWrapper<>();
        wrapperP.eq("teachers_class",4);
        List psychology = teachersService.selectList(wrapperP);
        //id 为5 对应的是英语组
        Wrapper<Teachers> wrapperE = new EntityWrapper<>();
        wrapperE.eq("teachers_class",5);
        List english = teachersService.selectList(wrapperE);
        //id 为6 对应的是物理组
        Wrapper<Teachers> wrapperPh = new EntityWrapper<>();
        wrapperPh.eq("teachers_class",6);
        List physics = teachersService.selectList(wrapperPh);
        //id 为7 对应的是生物组
        Wrapper<Teachers> wrapperB = new EntityWrapper<>();
        wrapperB.eq("teachers_class",7);
        List biology = teachersService.selectList(wrapperB);
        model.addAttribute("math",math);
        model.addAttribute("chinese",chinese);
        model.addAttribute("psychology",psychology);
        model.addAttribute("english",english);
        model.addAttribute("physics",physics);
        model.addAttribute("biology",biology);
        return PREFIX + "childhtml/teacher/teachtv/teacherpoeple/starimglist.html";

    }
    /*书香校园*/
    @RequestMapping(value = "/book")
    public String book(){
        return PREFIX +"/childhtml/teacher/teachlocal/booknice/starimglist.html";

    }
    /*团队在线*/
    @RequestMapping(value = "/team")
    public String team(){
        return PREFIX +"/childhtml/teacher/teachlocal/our/starimglist.html";

    }
    /*主题活动*/
    @RequestMapping(value = "/active")
    public String active(){
        return PREFIX + "childhtml/teacher/teachlocal/act/starimglist.html";
    }
    /*国旗下讲话的Controller单独写*/

    /*卫生角*/
    @RequestMapping(value = "/health")
    public String health(){
        return PREFIX + "childhtml/teacher/teachlocal/clear/starlist.html";
    }
    /*教学动态controller单独写*/
    /*送教上门，留言板块*/
    @RequestMapping(value = "/send")
    public String send(){
        return PREFIX + "childhtml/other/download/go/startalk.html";
    }
    /*软件下载*/
    @RequestMapping(value = "/softwaredownload")
    public String downLoad(){
        return PREFIX+"childhtml/other/download/usu/starlist.html";
    }
    /*留言板*/
    @RequestMapping(value = "/message")
    public String message(){
        return PREFIX + "childhtml/other/talk/talk/startalk.html";
    }
}
